package com.uni.action;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Random;

/**
 * --------------project-------------
 *
 * @Author Unirithe  - Mr.Chao
 * - CSDN:
 * https://blog.csdn.net/Unirithe
 * - GitHub:
 * https://github.com/unirithe
 * @create 2021/12/24 21:26
 * ------------------------------------------
 */
@WebServlet(name = "CodeAction", urlPatterns = "/code")
public class CodeAction extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int a = new Random().nextInt(100);
        int b = new Random().nextInt(100);
        int c = a + b;
        HttpSession session = req.getSession();
//        session.setAttribute("problem", a + " + " +  b  + " = " + " ? ");
//        session.setAttribute("answer", c);
        resp.sendRedirect("login.jsp");
    }
}
